<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./myPromise.js"></script>
    <script>
      console.log('---程序开始---');

      const p = new myPromise((resolve, reject) => {
        setTimeout(() => {
          resolve('成功了');
        }, 100);
      });

      myPromise.resolve('test').then((value) => {
        console.log('then==>', value);
      });

      myPromise.resolve(p).then((value) => {
        console.log('then==>', value);
      });

      console.log('---程序结束---');
    </script>
  </body>
</html>
